package org.luxor.html.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.luxor.commons.core.utils.BeanUtils;
import org.luxor.html.entity.User;
import org.luxor.html.mapper.UserMapper;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author Mr.Yan  @date 2019/9/25$
 */
@Slf4j
@Service
public class UserService extends ServiceImpl<UserMapper, User> {

    public IPage<User> page(IPage<User> page, Map query) {
        User queryEntity = BeanUtils.toObject(User.class, query);
        return super.page(page, Wrappers.query(queryEntity));
    }
}
